package com.lzy.tricbuild2_hash;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Objects;

/**
 * @ClassName:   TricNode
 * @Author:      Li ZhenYong
 * @description:  树节点
 * @Date:        2022-04-05 14:56
 * @Version:  1.0
 */
public class TricNode {

	public String data;
	public HashMap<String,TricNode> children = new HashMap();  // 表示存储的子节点的指针。当前默认存储的是26个字符
	public boolean isEndingChar = false; // 表示是否是最后一个字符串
	public TricNode(String data) {
		this.data = data;
	}


	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		TricNode tricNode = (TricNode) o;
		return data == tricNode.data;
	}

	@Override
	public int hashCode() {
		return Objects.hash(data);
	}
}
